//
//  UIView+DVFrame.m
//  DoctorVideo
//
//  Created by 锦食送 on 2019/8/1.
//  Copyright © 2019 lzx. All rights reserved.
//

#import "UIView+DVFrame.h"

@implementation UIView (DVFrame)

- (void)setDv_x:(CGFloat)dv_x {
    CGRect frame = self.frame;
    frame.origin.x = dv_x;
    self.frame = frame;
}

- (CGFloat)dv_x {
    return self.frame.origin.x;
}

- (void)setDv_y:(CGFloat)dv_y {
    CGRect frame = self.frame;
    frame.origin.y = dv_y;
    self.frame = frame;
}

- (CGFloat)dv_y {
    return self.frame.origin.y;
}

- (void)setDv_width:(CGFloat)dv_width {
    CGRect frame = self.frame;
    frame.size.width = dv_width;
    self.frame = frame;
}

- (CGFloat)dv_width {
    return self.frame.size.width;
}

- (void)setDv_height:(CGFloat)dv_height {
    CGRect frame = self.frame;
    frame.size.height = dv_height;
    self.frame = frame;
}

- (CGFloat)dv_height {
    return self.frame.size.height;
}

- (void)setDv_origin:(CGPoint)dv_origin {
    CGRect frame = self.frame;
    frame.origin = dv_origin;
    self.frame = frame;
}

- (CGPoint)dv_origin {
    return self.frame.origin;
}

- (void)setDv_size:(CGSize)dv_size {
    CGRect frame = self.frame;
    frame.size = dv_size;
    self.frame = frame;
}

- (CGSize)dv_size {
    return self.frame.size;
}

- (void)setDv_centerX:(CGFloat)dv_centerX {
    CGPoint center = self.center;
    center.x = dv_centerX;
    self.center = center;
}

- (CGFloat)dv_centerX {
    return self.center.x;
}

- (void)setDv_centerY:(CGFloat)dv_centerY {
    CGPoint center = self.center;
    center.y = dv_centerY;
    self.center = center;
}

- (CGFloat)dv_centerY {
    return self.center.y;
}

- (CGFloat)dv_midX {
    return CGRectGetMinX(self.frame);
}

- (CGFloat)dv_midY {
    return CGRectGetMidX(self.frame);
}

- (CGFloat)dv_maxX {
    return CGRectGetMaxX(self.frame);
}

- (CGFloat)dv_maxY {
    return CGRectGetMaxY(self.frame);
}

@end
